<%@ page import="com.portico.dept.solarch.Project" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <g:set var="entityName" value="${message(code: 'project.label', default: 'Project')}"/>
  <title><g:message code="default.show.label" args="[entityName]"/></title>
</head>
<body>
<div class="body">
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <br>
  <gui:expandablePanel title="Project Info" expanded="true">
  <div class="dialog">
    <table>
      <tbody>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.id.label" default="Id"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "id")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.name.label" default="Name"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "name")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.description.label" default="Description"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "description")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.projectType.label" default="Project Type"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "projectType")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.projectSubType.label" default="Project Sub Type"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "projectSubType")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.projectState.label" default="Project State"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "projectState")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.startDate.label" default="Start Date"/></td>

        <td valign="top" class="value"><g:formatDate date="${projectInstance?.startDate}"/></td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.endDate.label" default="End Date"/></td>

        <td valign="top" class="value"><g:formatDate date="${projectInstance?.endDate}"/></td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.sharePointUrl.label" default="Share Point Url"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "sharePointUrl")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.wikiUrl.label" default="Wiki Url"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "wikiUrl")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.showProjectDashboard.label" default="Show Project Dashboard"/></td>

        <td valign="top" class="value"><g:formatBoolean boolean="${projectInstance?.showProjectDashboard}"/></td>

      </tr>
      <sec:ifAnyGranted roles="ROLE_SUPER_USER, ROLE_ADMIN_USER">

        <tr class="prop">
          <td valign="top" class="name"><g:message code="project.projectAdmins.label" default="Project Admins"/></td>

          <td valign="top" style="text-align: left;" class="value">
            <ul>
              <g:each in="${projectInstance.projectAdmins}" var="p">
                <li><g:link controller="user" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
              </g:each>
            </ul>
          </td>

        </tr>
      </sec:ifAnyGranted>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.projectNumber.label" default="Project Number"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "projectNumber")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.sponsor.label" default="Sponsor"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "sponsor")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><g:message code="project.technicalManager.label" default="Technical Manager"/></td>

        <td valign="top" class="value">${fieldValue(bean: projectInstance, field: "technicalManager")}</td>

      </tr>

      </tbody>
    </table>
  </div>
  <div class="buttons">
    <g:form>
      <g:hiddenField name="id" value="${projectInstance?.id}"/>
      <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}"/></span>
      <sec:ifAnyGranted roles="ROLE_SUPER_USER, ROLE_ADMIN_USER">
        <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');"/></span>
      </sec:ifAnyGranted>
    </g:form>
  </div>
  </gui:expandablePanel>
  <h2></h2>

  <br>

  <gui:accordion multiple="true">
    <gui:accordionElement id="${projectInstance.id}-status" title="Status Detail">
      <g:render template="/projectStatus/statusList" model="['projectStatusInstanceList':projectInstance.recurringStatus]"/>
    </gui:accordionElement>
    <gui:accordionElement id="${projectInstance.id}-Quality" title="Quality Detail">
      <g:render template="/projectQuality/qualityList" model="['projectQualityInstanceList':projectInstance.qualityDetails]"/>
    </gui:accordionElement>
    <gui:accordionElement id="${projectInstance.id}-TestCaseSummary" title="Test Case Summary">
      <g:render template="/testCaseExecutionHistory/testCaseExecutionlist"
                model="['testCaseExecutionHistoryInstanceList':projectInstance.testCaseExecutionHistory]"/>
    </gui:accordionElement>
      <gui:accordionElement id="${projectInstance.id}-Risks" title="Risks Detail">
        <g:render template="/projectRisks/riskList" model="['projectRisksInstanceList':projectInstance.risks]"/>
      </gui:accordionElement>
    <gui:accordionElement id="${projectInstance.id}-Team" title="Team Detail">
      <g:render template="/projectTeamMember/teamMemberList" model="['projectTeamMemberInstanceList':projectInstance.roster]"/>
    </gui:accordionElement>

  </gui:accordion>

</div>
</body>
</html>
